import { EntitySchema } from '@mikro-orm/core';

export class LeUserLabelLog {
  id!: string;
  UID!: string;
  labelId!: string;
  createdTime?: string;
  updatedTime?: string;
  deletedTime?: string;
  isDeleted: number = 0;
}

export const LeUserLabelLogSchema = new EntitySchema({
  class: LeUserLabelLog,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    UID: { type: 'string', fieldName: 'UID', columnType: 'bigint', index: '用户ID' },
    labelId: { type: 'string', columnType: 'bigint', index: '标签ID' },
    createdTime: { type: 'string', columnType: 'bigint', nullable: true, defaultRaw: `0` },
    updatedTime: { type: 'string', columnType: 'bigint', nullable: true, defaultRaw: `0` },
    deletedTime: { type: 'string', columnType: 'bigint', nullable: true, defaultRaw: `0` },
    isDeleted: { type: 'number', columnType: 'tinyint', default: 0 },
  },
});
